$(function(){
	$('#picture_label').image_uploader({target_selector:'#picture_label',input_name:'picture_label',img_src:img_url});
	$('#email_edition').modalpop({action:save_email,title:'save email',beforeShow:populate_email_edition,afterClose:function(){$('#email_edition').modalpop('clean')}});
	$('#website_edition').modalpop({action:save_website,title:'save website',beforeShow:populate_website_edition,afterClose:function(){$('#website_edition').modalpop('clean')}});
	$('#facebook_edition').modalpop({action:save_facebook,title:'save facebook',beforeShow:populate_facebook_edition,afterClose:function(){$('#facebook_edition').modalpop('clean')}});
	$('#twitter_edition').modalpop({action:save_twitter,title:'save twitter',beforeShow:populate_twitter_edition,afterClose:function(){$('#twitter_edition').modalpop('clean')}});
	$('#edit_email').click(function(){$('#email_edition').modalpop('open');});
	$('#edit_website').click(function(){$('#website_edition').modalpop('open');});
	$('#edit_facebook').click(function(){$('#facebook_edition').modalpop('open');});
	$('#edit_twitter').click(function(){$('#twitter_edition').modalpop('open');});
	$('[name="picture_label"]').html5Uploader({
		postUrl: PrivateUrls['CHANGE_IMG']	
	});	 
});

function populate_email_edition(){
	$('#email').val($('#email_label').text());
}


function populate_website_edition(){
	$('#website').val($('#website_label').text());
}

function populate_facebook_edition(){
	$('#facebook').val($('#facebook_label').text());
}



function populate_twitter_edition(){
	$('#twitter').val($('#twitter_label').text());
}

